days=1
while [ $days -le 28 ]
do 
    datestr=`date "-d $days days ago" +%Y%m%d` 
    echo $datestr
    pathIndex=$(($days%2+1)) 
   	rsync -azv 10.129.145.217::data$pathIndex/webqq/$datestr/10.134.131.213/data/log_cgi-android_msg-tomcat?.log.201* /data/java/logs/cgi-android2/
	((days += 1))
done
cd /data/java/logs/cgi-android/
for i in *.tgz;
do tar -xvf $i;
echo $i;
rm $i;
done
mv data/java/logs/cgi-android/* .
rm -r data
